import http from '@/utils/http'

import {
	adviceResponse
} from './app.js';

export function getList(param) {
	let acToken = uni.getStorageSync('userToken');
	http.config.header.Authorization = acToken;

	var config = http.post('/wx/payModel/getList', param , {
		loadingText: false
	});

	return adviceResponse(config);
}

export function submit(payModel) {
	let acToken = uni.getStorageSync('userToken');
	http.config.header.Authorization = acToken;

	var config = http.post('/wx/payModel/submit', payModel , {
		loadingText: false
	});

	return adviceResponse(config);
}

export function getOrder(payModel) {
	let acToken = uni.getStorageSync('userToken');
	http.config.header.Authorization = acToken;

	var result = http.post('/wx/pay/getOrder', payModel , {
		loadingText: false
	});

	return adviceResponse(result);
}

export function getRecordResult(param) {
	let acToken = uni.getStorageSync('userToken');
	http.config.header.Authorization = acToken;

	var config = http.post('/wx/payRecord/getRecordResult', param , {
		loadingText: false
	});

	return adviceResponse(config);
}